Skip to content

Commit 524725e

Browse files
committed
first commit
0 parents  commit 524725e

File tree

20 files changed

+3606
-0
lines changed

20 files changed

+3606
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eleventy.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
const sitemap = require('@quasibit/eleventy-plugin-sitemap');
2+
const htmlmin = require('html-minifier-terser');
3+
const fs = require('fs');
4+
5+
function minifyJsonLd(content) {
6+
return content.replace(
7+
/(<script type="application\/ld\+json">)([\s\S]*?)(<\/script>)/g,
8+
(_, openTag, jsonContent, closeTag) => {
9+
const minifiedJson = JSON.stringify(JSON.parse(jsonContent));
10+
return `${openTag}${minifiedJson}${closeTag}`;
11+
}
12+
);
13+
}
14+
15+
module.exports = (eleventyConfig) => {
16+
// Passthrough copy for static assets
17+
eleventyConfig.addPassthroughCopy('src/assets');
18+
19+
const hostname = 'https://misakisota.github.io/';
20+
21+
// Add sitemap plugin
22+
eleventyConfig.addPlugin(sitemap, {
23+
sitemap: {
24+
hostname: hostname,
25+
},
26+
});
27+
28+
eleventyConfig.on('afterBuild', () => {
29+
//Replace url in Sitemap
30+
const sitemap = fs.readFileSync('_site/sitemap.xml', 'utf8');
31+
const sitemapWithHostname = sitemap.replace(/https:\/\/misakisota.github.io\//g, hostname + 'tools/');
32+
fs.writeFileSync('_site/sitemap.xml', sitemapWithHostname);
33+
});
34+
35+
eleventyConfig.on('afterBuild', () => {
36+
const CleanCSS = require('clean-css');
37+
38+
// Run me after the build ends
39+
var inputFile = 'src/assets/css/style.css';
40+
var input = fs.readFileSync(inputFile, 'utf8');
41+
var output = new CleanCSS().minify(input);
42+
fs.writeFile('_site/assets/css/style.css', output.styles, function (err) {
43+
if (err) return console.log('Error minifying style.css' + err);
44+
});
45+
});
46+
47+
// Minify HTML output
48+
eleventyConfig.addTransform('htmlmin', function (content, outputPath) {
49+
if (outputPath && outputPath.endsWith('.html')) {
50+
content = minifyJsonLd(content);
51+
let minified = htmlmin.minify(content, {
52+
removeComments: true,
53+
collapseWhitespace: true,
54+
removeAttributeQuotes: true,
55+
minifyJS: true,
56+
minifyCSS: true,
57+
});
58+
return minified;
59+
}
60+
61+
return content;
62+
});
63+
64+
// Define directories
65+
return {
66+
dir: {
67+
input: 'src',
68+
output: '_site',
69+
layouts: 'layouts',
70+
includes: 'includes',
71+
data: 'data',
72+
},
73+
passthroughFileCopy: true,
74+
};
75+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
### Describe the bug
10+
11+
A clear and concise description of what the bug is.
12+
13+
### To Reproduce
14+
15+
Steps to reproduce the behavior:
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. See error
20+
21+
### Expected behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
<!-- The following items are not required, if you do not need them, please delete them -->
26+
27+
### Screenshots
28+
29+
If applicable, add screenshots to help explain your problem.
30+
31+
### Additional context
32+
33+
Add any other context about the problem here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
### What problem does this feature solve?
10+
11+
A clear and concise description of the problem or need.
12+
13+
### Describe the solution you'd like
14+
15+
A clear and concise description of what you want to happen.
16+
17+
<!-- The following items are not required, if you do not need them, please delete them -->
18+
19+
### Describe alternatives you've considered
20+
21+
A clear and concise description of any alternative solutions or features you've considered.
22+
23+
### Additional context
24+
25+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Overview
2+
3+
Provide a brief overview of the changes introduced by this pull request.
4+
5+
### Changes Made
6+
7+
Clearly describe what changes were made in this pull request.
8+
9+
### Issues Resolved
10+
11+
Explain the issues or problems that this pull request solves.
12+
13+
### Additional Changes
14+
15+
Describe any new features or improvements that were added as part of this change.
16+
17+
## Checklist
18+
19+
- [ ] The code follows the style guide.
20+
- [ ] Tests have been run and all tests have passed.
21+
- [ ] Documentation has been updated where necessary.

.github/workflows/deploy.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '22'
29+
30+
- name: Install dependencies
31+
run: |
32+
yarn install
33+
34+
- name: Build site
35+
run: |
36+
yarn build
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: ./_site
42+
43+
deploy:
44+
environment:
45+
name: GitHub Pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Dependency directory
2+
node_modules/
3+
4+
# Log files
5+
*.log
6+
7+
# Mac OS
8+
.DS_Store
9+
10+
# Build files
11+
_site/

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 110,
3+
"quoteProps": "as-needed",
4+
"semi": true,
5+
"singleQuote": true,
6+
"tabWidth": 2,
7+
"trailingComma": "es5",
8+
"useTabs": false
9+
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["esbenp.prettier-vscode", "EditorConfig.EditorConfig"]
3+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"quickfix.biome": "explicit",
6+
"source.addMissingImports.ts": "always"
7+
}
8+
}

0 commit comments

Comments
 (0)