A theme for hugo made using tailwind CSS library and mono font family
- This theme uses tailwind CSS
- [Optional] How to Use Tailwind
- By default, the existing
tailwind.css
file will be used in the theme but if you want to play around with tailwind then follow the steps mentioned below - There are two config files for tailwind located in
assets/csss/tailwind
directory- For dev run
npm run dev
-> This generates all the possible CSS classes from tailwind. Some may still be left out - For prod run
npm run prod
-> This generates only the CSS classes from tailwind that you are using in the theme
- For dev run
- By default, the existing
hugo new site <SITE_NAME>
cd <SITE_NAME>
git submodule add [email protected]:techbarrack/terminal-hugo-theme.git themes/terminal
- Replace the contents of
<SITE_NAME>/hugo.yaml
with<SITE_NAME>/themes/terminal/hugo.yaml
- In the root directory of the hugo site, create the directory:
mkdir -p layouts/partials/third_party_js
. This directory is to store any sort of third party javascript like google analytics, disqus, etc - Run the website
hugo server --buildDrafts --disableFastRender --gc --ignoreCache --noHTTPCache --forceSyncStatic --verbose -w
- Uncomment the ignoreFiles attribute in
<SITE_NAME>/hugo.yaml
- Start adding the files in
<SITE_NAME>/content
by replicating what is present in<SITE_NAME>/themes/terminal/content
- Update the meta content in
head.html
- Create partials in
<SITE_NAME>/layouts/partials/third_party_js/<FILE>.html
- All the files in
third_party_js
folder will get included before</body>
tag
{{< svg logo="blah" >}}
-> Use the following code to add svg in markdown files- Add svg as .html file in
layouts/content/svg
- Add svg as .html file in
- Raw HTML
{{< rawhtml >}}
<div>This is raw HTML content</div>
{{< /rawhtml >}}
Some reference links for additional info on how to do things in Hugo:
- https://gohugo.io/methods/page/
- https://gohugo.io/methods/pages/groupbydate/
- https://gohugo.io/content-management/taxonomies/
- https://gohugo.io/templates/taxonomy-templates/
- https://gohugo.io/templates/taxonomy-templates/#example-list-tags-in-a-single-page-template
- https://gohugo.io/templates/taxonomy-templates/#example-list-tags-in-a-single-page-template
- https://gohugo.io/methods/page/scratch/
- https://gohugo.io/functions/collections/dictionary/
- https://gohugo.io/methods/page/paginate/
- https://discourse.gohugo.io/t/better-term-listing/10261
- https://gohugo.io/templates/partials/
- https://mertbakir.gitlab.io/hugo/pass-arguments-in-partials-hugo/
- SVG Icons