www.lucasyamamoto.com.golang is a blog built with my own static site generator written in Go. It parses markdown files, applies layout templates, and generates a complete website including assets and sitemaps, ready to be deployed.
- Markdown Parsing: Efficiently parses markdown files from
_posts
and_pages
folders, transforming them into HTML while extracting frontmatter. - Template Loading: Utilizes the
text/template
library to apply_layouts
and include_includes
, enabling reusable website components. - Site Generation: Generates the entire website, including homepage, posts, pages, assets, and a sitemap, according to the specifications in
_config.yml
. - Dynamic Content: Supports pagination and JSON data generation, allowing for dynamic content presentation.
- Sitemap Generation: Automatically generates a sitemap for SEO optimization, ensuring your site is fully indexed by search engines.
- Go installed on your machine (version 1.21).
- Basic understanding of Go programming.
- Familiarity with Markdown and YAML configurations.
- Node 18.x (used only to build the SASS)
Clone the repository to your local machine:
git clone https://github.com/lucasayb/www.lucasyamamoto.com.golang.git
cd www.lucasyamamoto.com.golang
In the .vscode
folder, I added a two files:
launch.json
: Every time that any file is saved into the repository, the command to build the site is executedsettings.json
: I added the_site
as the base folder in which the live server will run.
- Configure Your Site: Edit the
_config.yml
file to match your site's specifications. - Prepare Content: Add your markdown files to the
_posts
and_pages
directories. - Add you SASS files: The SASS files needs to be into the
sass
folder. - Build Your CSS: Run the following command to build your css:
yarn build:css
- Build Your Site: Run the following command to build your site:
yarn build
Keep in mind that both commands will run after the yarn install
because they are into the postinstall
scripts of the package.json
The site will be generated in the _site
directory, ready to be deployed.
parser/parser.go
: Parses markdown files, transforms them into HTML, and extracts frontmatter.loader/loader.go
: Applies layout templates and includes using thetext/template
library.generator/generator.go
: Responsible for generating the entire site, including assets, pages, and the sitemap.
We welcome contributions to www.lucasyamamoto.com.golang! Whether it's submitting bug reports, feature requests, or contributing code, here's how you can get involved:
- Fork the repository and create your feature branch:
git checkout -b my-new-feature
. - Commit your changes:
git commit -am 'Add some feature'
. - Push to the branch:
git push origin my-new-feature
. - Submit a pull request: Ensure your code adheres to the project's standards and includes appropriate tests and documentation.
This project is open source and available under the MIT License.