-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.html
More file actions
125 lines (123 loc) Β· 8.39 KB
/
README.html
File metadata and controls
125 lines (123 loc) Β· 8.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>π makesite</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8">
<h1 class="display-4 text-center mb-4">π makesite</h1>
<div class="card">
<div class="card-body">
<div class="card-text" ><h1>π makesite</h1>
<p><a href="https://goreportcard.com/report/github.com/kangjoa/makesite"><img src="https://goreportcard.com/badge/github.com/kangjoa/makesite" alt="Go Report Card"></a></p>
<p><em>Create your own custom Static Site Generator (like <a href="https://jekyllrb.com/">Jekyll</a> or <a href="https://gohugo.io/">Hugo</a>) by cloning and completing this project!</em></p>
<h3>π Table of Contents</h3>
<ol>
<li><a href="#project-structure">Project Structure</a></li>
<li><a href="#getting-started">Getting Started</a></li>
<li><a href="#deliverables">Deliverables</a></li>
<li><a href="#resources">Resources</a></li>
</ol>
<h2>Project Structure</h2>
<pre><code class="language-bash">π makesite
βββ README.md
βββ first-post.txt
βββ latest-post.txt
βββ makesite.go
βββ template.tmpl
</code></pre>
<h2>Getting Started</h2>
<ol>
<li>Visit <a href="https://github.com/new">github.com/new</a> and create a new repository named <code>makesite</code>.</li>
<li>Run each command line-by-line in your terminal to set up the project:</li>
</ol>
<pre><code class="language-bash">$ git clone git@github.com:Tech-at-DU/makesite.git
$ cd makesite
$ git remote rm origin
$ git remote add origin git@github.com:YOUR_GITHUB_USERNAME/makesite.git
</code></pre>
<h2>Deliverables</h2>
<p><strong>For each task</strong>:</p>
<ul>
<li>Complete each task in the order they appear.</li>
<li>Use <a href="https://help.github.com/en/github/managing-your-work-on-github/about-task-lists">GitHub Task List</a> syntax to update the task list.</li>
</ul>
<h3>MVP</h3>
<p>Complete the MVP as If you finish early, move on to the stretch challenges.</p>
<p>If you get stuck on any step, be sure to print the output to <code>stdout</code>!</p>
<h4>v1.0 Requirements</h4>
<ul>
<li>[x] Edit line <code>4</code> of <code>README.md</code>. Change this line to the following, replacing <code>YOUR_USERNAME</code> and <code>YOUR_REPONAME</code> with your GitHub username and repository name respectively.</li>
<li>[x] Read in the contents of the provided <code>first-post.txt</code> file.</li>
<li>[x] Edit the provided HTML template (<code>template.tmpl</code>) to display the contents of <code>first-post.txt</code>.</li>
<li>[x] Render the contents of <code>first-post.txt</code> using Go Templates and print it to stdout.</li>
<li>[x] Write the HTML template to the filesystem to a file. Name it <code>first-post.html</code>.</li>
<li>[x] Manually test the generated HTML page by running <code>./makesite</code>. Double-click the <code>first-post.html</code> file that appears in your directory after running the command to open the generated page in your browser.</li>
<li>[x] <strong>Add, commit, and push to GitHub</strong>.</li>
<li>[x] Add a new flag to your command named <code>file</code>. This flag represents the name of any <code>.txt</code> file in the same directory as your program. Run <code>./makesite --file=latest-post.txt</code> to test.</li>
<li>[x] Update the <code>save</code> function to use the input filename to generate a new HTML file. For example, if the input file is named <code>latest-post.txt</code>, the generated HTML file should be named <code>latest-post.html</code>. Run <code>go run makesite.go --file=latest-post.txt</code></li>
<li>[x] <strong>Add, commit, and push to GitHub</strong>.</li>
</ul>
<h4>v1.0 Stretch Challenges</h4>
<ul>
<li>[x] Use Bootstrap, or another CSS framework, to enhance the style and readability of your template. <em>Get creative! Writing your very own website generator is a great opportunity to broadcast your style, personality, and development preferences to the world!</em></li>
</ul>
<h3>v1.1</h3>
<h4>v1.1 Requirements</h4>
<ul>
<li>[x] Create 3 new <code>.txt</code> files for testing in the same directory as your project.</li>
<li>[x] Add a new flag to the <code>makesite</code> command named <code>dir</code>.</li>
<li>[x] Use the flag to find all <code>.txt</code> files in the given directory. Print them to <code>stdout</code>.</li>
<li>[x] With the list of <code>.txt</code> files you found, generate an HTML page for each.</li>
<li>[x] Run <code>./makesite --dir=.</code> to test in your local directory.(or <code>go run makesite.go --dir=.</code>)</li>
<li>[x] <strong>Add, commit, and push to GitHub</strong>.</li>
</ul>
<h4>v1.1 Stretch Challenges</h4>
<ul>
<li>[ ] Recursively find all <code>.txt</code> files in the given directory, as well as it's subdirectories. Print them to <code>stdout</code> to make sure. Generate an HTML page for each.</li>
<li>[x] When your program finishes, print: <code>Success! Generated 5 pages.</code> The <code>Success!</code> substring must be <span style="color: green; font-weight:bold;">bold green</span>, and the count (<code>5</code>) must be <strong>bold</strong>.</li>
<li>[ ] Modify the success message to read: <code>Success! Generated 5 pages (18.2kB total).</code> Calculate the total by summing the size of each HTML file, then converting the total to kilobytes. Always return one significant digit after the decimal point.</li>
<li>[ ] Determine how long it took to execute your static site generator. Modify the success message to read: <code>Success! Generated 5 pages (18.2kB total) in 3.25 seconds.</code> Always return two significant digits after the decimal point.</li>
<li>[ ] Test your solutions to these stretch challenges on many different directories containing <code>.txt</code> files. Are there any ways to make your code faster?</li>
</ul>
<h3>v1.2</h3>
<h4>v1.2 Requirements</h4>
<ul>
<li>[x] Initialize Go modules in your project.</li>
<li>[x] Add any third party library to your project to enhance it's functionality. Some ideas you might consider include <strong><em>(CHOOSE ONLY ONE)</em></strong>:
<ul>
<li>[ ] Translating page content using Google Translate.</li>
<li>[x] Parse Markdown (<code>.md</code>) files and transform them into HTML. <code>#</code> through <code>######</code> should translate to <code><h1></code> through <code><h6></code> elements. Add to import and then run <code>go get github.com/yuin/goldmark</code>. go.mod will be updated.</li>
<li>[x] <strong><em>FILL IN THE BLANK</em></strong>: <code>I will use the _goldmark_ library. The documentation is located at _https://pkg.go.dev/github.com/yuin/goldmark#section-readme_. My goal is to use it to _parse Markdown (</code>.md<code>) files and transform them into HTML_.</code></li>
</ul>
</li>
<li>[x] <strong>Add, commit, and push to GitHub</strong>.</li>
</ul>
<h2>Resources</h2>
<h3>Lesson Plans</h3>
<ul>
<li><a href="https://tech-at-du.github.io/ACS-4210-Strongly-Typed-Languages/#/Lessons/SSGProject"><strong>ACS 4210</strong>: Project #1 - SSGs</a>: Code samples you can use to complete the MVP requirements.</li>
<li><a href="https://tech-at-du.github.io/ACS-4210-Strongly-Typed-Languages/#/Lessons/FilesDirectories"><strong>ACS 4210</strong>: Files & Directories</a>: Code samples you can use to complete v1.1 requirements.</li>
<li><a href="https://tech-at-du.github.io/ACS-4210-Strongly-Typed-Languages/#/Lessons/3rdPartyLibs"><strong>ACS 4210</strong>: Files & Directories</a>: Code samples you can use to complete v1.2 requirements.</li>
</ul>
<h3>Example Code</h3>
<ul>
<li><a href="https://gobyexample.com/reading-files"><strong>Go By Example</strong>: Reading Files</a></li>
<li><a href="https://gobyexample.com/writing-files"><strong>Go By Example</strong>: Writing Files</a></li>
<li><a href="https://gobyexample.com/panic"><strong>Go By Example</strong>: Panic</a></li>
<li><a href="https://blog.gopheracademy.com/advent-2017/using-go-templates/"><strong>GopherAcademy</strong>: Using Go Templates</a></li>
<li><a href="https://blog.rapid7.com/2016/08/04/build-a-simple-cli-tool-with-golang/"><strong>rapid7.com</strong>: Building a Simple CLI Tool with Golang</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>