This is the new version of my portfolio, the architecture is inspired by fireship.io
Made with
- Static Site Generation Hugo
- Styling SCSS
- Web Components with LitElement
See this diagram for a more intuitive explanation
Todo: put image of diagram here
It follows SASS guidelines for styling
- Make
.tsfile that would be the component class. - Declare your webcomponent class in
web-components.tswithcustomElements.define()method. - Run
npm run build:hugoto bundle the declared components into a.jsoptimized file. This script will move the bundle to the hugo static files folder. - Since the bundle filename is not constant (it varies depending on the build) you can access the bundle filename in Hugo's templates via the .Data variable, that is,
{{ .Site.Data.components.bundle }}
Access the bundle filename via a script tag
<script type="module" src="components/{{.Site.Data.components.bundle}}"></script>