Create your own custom Static Site Generator (like Jekyll or Hugo) by cloning and fulfilling the requirements in this repo!
📂 makesite
├── README.md
├── first-post.txt
├── latest-post.txt
├── makesite.go
└── template.tmpl
- Visit github.com/new and create a new repository named
makesite
. - Run each command line-by-line in your terminal to set up the project:
$ git clone git@github.com:Make-School-Labs/makesite.git
$ cd makesite
$ git remote rm origin
$ git remote add origin git@github.com:YOUR_GITHUB_USERNAME/makesite.git
For each task:
- Complete each task in the order they appear.
- Use GitHub Task List syntax to update the task list.
Complete the MVP as If you finish early, move on to the stretch challenges.
If you get stuck on any step, be sure to print the output to stdout
!
- Edit line
4
ofREADME.md
. Change this line to the following, replacingYOUR_USERNAME
andYOUR_REPONAME
with your GitHub username and repository name respectively. - Read in the contents of the provided
first-post.txt
file. - Edit the provided HTML template (
template.tmpl
) to display the contents offirst-post.txt
. - Render the contents of
first-post.txt
using Go Templates and print it to stdout. - Write the HTML template to the filesystem to a file. Name it
first-post.html
. - Manually test the generated HTML page by running
./makesite
. Double-click thefirst-post.html
file that appears in your directory after running the command to open the generated page in your browser. - Add, commit, and push to GitHub.
- Add a new flag to your command named
file
. This flag represents the name of any.txt
file in the same directory as your program. Run./makesite --file=latest-post.txt
to test. - Update the
save
function to use the input filename to generate a new HTML file. For example, if the input file is namedlatest-post.txt
, the generated HTML file should be namedlatest-post.html
. - Add, commit, and push to GitHub.
- Use Bootstrap, or another CSS framework, to enhance the style and readability of your template. Get creative! Writing your very own website generator is a great opportunity to broadcast your style, personality, and development preferences to the world!
- Create 3 new
.txt
files for testing in the same directory as your project. - Add a new flag to the
makesite
command nameddir
. - Use the flag to find all
.txt
files in the given directory. Print them tostdout
. - With the list of
.txt
files you found, generate an HTML page for each. - Run
./makesite --dir=.
to test in your local directory. - Add, commit, and push to GitHub.
GOROOT="/usr/local/Cellar/go/1.15.5/libexec" GO111MODULE="" GOPATH="/Users/aspin25/go"
- Initialize Go modules in your project.
- Add any third party library to your project to enhance it's functionality. Some ideas you might consider include (CHOOSE ONLY ONE):
- Translating page content using Google Translate.
-
I will use the google translate library. The documentation is located at https://pkg.go.dev/cloud.google.com/go/translate. My goal is to use it to give users the option to translate text files.
- Add, commit, and push to GitHub.
- BEW 2.5: Project #1 - SSGs: Code samples you can use to complete the MVP requirements.
- BEW 2.5: Files & Directories: Code samples you can use to complete v1.1 requirements.
- BEW 2.5: Files & Directories: Code samples you can use to complete v1.2 requirements.