Mike Gerwitz

Free Software Hacker+Activist

aboutsummaryrefslogtreecommitdiffstats
blob: d67f5d13c2590787a55d990f4bb245a3d12f1f01 (plain)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
#
# Basic template configuration; command-line options will override
#
#  Copyright (C) 2013, 2015, 2016  Mike Gerwitz
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
# #

get-menu-docs()
{
  # we shall only consider ordered pages---that is, those that begin with numbers; this
  # allows pages to exist that are not listed in the menu
  paths=$(
    find "$path_root/docs" -maxdepth 1 -name '[0-9][0-9]-*.??' \
      -exec basename {} \; \
      | sort
  )

  for p in $paths; do
    # we shall consider the name of the link to be the path with the extension
    # and sorting prefix stripped
    name="$( basename "${p%%.*}" )"
    echo "${name#??-}"
  done
}

html_external_css=/style.css

# lets certain browsers---such as the proprietary mobile Safari browser that
# seems to be far too Ubiquitous---know that they should trust us with rendering
# the page to fit within the device's screen resolution
html_head='<meta name="viewport" content="initial-scale=1.0" />'

# menu just below the header, above the index
html_pre_index="$(

  echo '<ul id="menu">'

  # generate menu from the root documents
  for name in `get-menu-docs`; do
    # each word in the name will be capitalized and the link shall not contain
    # the file extension
    words=( ${name//[_-]/ } )
    printf '<li><a href="/%s">%s</a></li>' "$name" "${words[*]^}"
  done
  echo '<li><a href="//social.mikegerwitz.com/"' \
    'title="My GNU Social Instance">Social</a></li>'

  # the remainder will appear below the menu, above the index
cat <<EOH
  </ul>
  <div id="headline">
    <a href="https://www.eff.org/nsa-spying">
      <img src="/images/eff-nsa-spying.png"
        alt="NSA Spying on Americans"
        title="NSA Spying on Americans" />
    </a>

    <a href="http://upgradefromwindows8.com">
      <img src="/images/win8-close.png"
        alt="Close Windows, Open Doors" />
    </a>
  </div>
EOH
)"


# additional content in the footer before the copyright (the awkward newline
# positions are to prevent spaces in the output)
html_footer=$(cat <<EOM
  <a href="/about/inside" id="gnuinside">
    <img src="/images/gnu-inside.png" alt="GNU/Linux Inside!" />
  </a>

  <div class="bimgs">
    <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"
      ><img src="/images/cc-bysa-88x31.png"
        alt="[CC BY-SA]"
        title="Creative Commons Attribution-ShareAlike"
        width="88" height="31" border="0"
    /></a>

    <a href="http://www.fsf.org/register_form?referrer=5804"
      ><img src="/images/fsf-member.png"
        alt="[FSF Associate Member since 2007-10-31]"
        title="FSF Associate Member"
        width="125" height="31" border="0"
    /></a>

    <a href="http://www.defectivebydesign.org/join/button"
      ><img src="/images/elim-drm.gif"
        alt="[ Eliminate DRM! ]"
        title="Eliminate DRM!"
        width="88" height="30" border="0"
    /></a>
  </div>
EOM
)


# index-only footer (we don't want too much spam; the other pages look much
# cleaner without this)
html_index_footer=$(cat <<EOM
  <div id="selflinks">
    <a href="https://gitlab.com/u/mikegerwitz">
      <img src="/images/gitlab.svg"
        alt="mikegerwitz on GitLab"
        title="mikegerwitz on GitLab"
        width="42" height="42" border="0"
        />
    </a>

    <a href="/about/githubbub">
      <img src="/images/octoright-42.png"
        alt="Don't see me on GitHub"
        title="Don't see me on GitHub"
        width="42" height="42" border="0"
        />
    </a>

    <a href="https://savannah.gnu.org/users/mikegerwitz">
      <img src="/images/meditate-42.png"
        alt="See me on Savannah"
        title="See me on Savannah"
        width="42" height="42" border="0"
        />
    </a>

    <a href="https://news.ycombinator.com/user?id=mikegerwitz"
       title="mikegerwitz on Hacker News"
       class="hn-icon">HN</a>

    <a href="https://www.fsf.org/register_form?referrer=5804">
      <img src="/images/fsf-42.png"
        alt="FSF Member #5804"
        title="FSF Member #5804"
        width="42" height="42" border="0"
        />
    </a>

    <a href="https://www.eff.org/">
      <img src="/images/eff-42.png"
        alt="EFF Member"
        title="EFF Member"
        width="42" height="42" border="0"
        />
    </a>
  </div>
EOM
)