diff --git a/LICENSE b/LICENSE index 46fe619a62e0888e3317ff7bd73fc3b6f86bd62e..5aef6fb05cb4fca02b13159f12f5307b7aafc859 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,29 @@ -The MIT License (MIT) +BSD 3-Clause License -Copyright (c) 2019 YOUR_NAME_HERE +Copyright (c) 2020, Center for Nuclear Study, the University of Tokyo +All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4277677344451fefc2e52cdf3ddad38d9137867d --- /dev/null +++ b/README.md @@ -0,0 +1,212 @@ +# White Cabinet theme for Hugo + +White Cabinet theme can make sites with + +- slide images +- site title w/ black ribbon & hamburger menu +- accordion menu (expandable menu) +- post card +- banner at sidebar +- quicklinks (& address) + +components. White Cabinet theme can create introduction site for indivisual, group and all of facilities with upcoming/past events, information, location, etc... + + + +See our **[Demo page]()** + +White Cabinet theme deal with not only PC but also Mobile without any extra codes. + +## Installation + +1. Install [Hugo](https://gohugo.io/) in your server/client. +1. Make web source directory (ex. `/foo/bar`) and clone our git repository + +``` +$ mkdir -p /foo/bar/themes +$ cd /foo/bar/themes +$ git clone ---NEED TO CHECK--- +``` + +1. If you test by our demo page, please type such as: + +``` +$ cp white_cabinet_themes/demo-page/ /foo/bar/ +$ hugo server +``` + +and access to `localhost:1313` in your web browser, you will check it. + +Here in README is according to the demo pages. + +## Edit `config.toml` +You can customize the site at the `config.toml`. + +1. At first, edit your server name + +```config.toml +baseurl = (*_YOUR_SERVER_NAME_*) +``` + +2. You can set the parameters in each lauguage code. +These are the example in the case of English. +各言語のページは自動的に作られます。baseurl/en/ +index.en.md, index.ja.md, .... + +```config.toml +[Languages] +[Languages.en] + title = "THE TITLE OF YOUR SITE" +[Languages.en.params] + subtitle = "THE SUBTITLE OF YOUR SITE" + ... +[[Languages.en.menu.main]] + ... +``` + + + +### Header +At the header, following contents are stored: + - title and subtitle + - logo + - slide images (= top figures) + - hamburger menu : automatically changed with accordion menu. + - heder menu + + +#### 1. Change the title. + +The site title can be changed by the parameter `title`. +```config.toml +[Languages] +[Languages.en] + title = "SITE TITLE" +[Languages.en.params] + subtitle = "SITE SUBTITLE" +``` + +#### 2. Change the logo and top figures. + +Prepare image files for logo and top figures and copy them under the directory "static". + +(ex. logo: `/foo/bar/static/img/logo.png`, top figure: `/foo/bar/static/img/topfig1.jpg`) + +Change the path to files at `config.toml`. +Several image files are supported for top figures in sliding style. + +```config.toml +[Params] + logo = "img/logo.png" + top_figures = [ + "img/topfig1.jpg", + "PATH TO FILE2", + "PATH TO FILE3" + ] +``` + +#### 3. Change the header menu. + +To add new header menu, add new parameter block `menu.header`. + + +```config.toml +[[menu.header]] + name = "DISPLAYED NAME" + url = "/URL" #Permanent Link of content + weight = 1 #Order of each menu +``` + +To add banner link, add new parameter block `Params.exlink`. + +```config.toml +[[Params.exlink]] + url = "LINK" + pass = "PATH TO IMAGES" +``` + +### Main contents + +In White Cabinet theme, accordion menu is used as top menu. +Hamburger menu at header is automatically changed with accordion menu. + +To add new accordion menu, add new parameter block `menu.main`. + +```config.toml +[[menu.main]] + identifier = "ID" #Identifier for each menu + name = "DISPLAYED NAME" + url = "/URL" #Permanent Link of content + weight = 1 #Order of each menu + pre = "open"/"closed" #Default status of accordion menu +``` + +In this case, the page created by `/foo/bar/content/URL/_index.md` is corresponded. +
You can store contents in three ways for each accordion menu: + - list + - tile + - post card +
To use the postcard style, add parameter `post = "postcard"` in the block `menu.header`. + +See **[HOW TO MENU]()** for more information. + +### Sidebar (list of banners) + +There are List of banners and "Links" at the sidebar. + +Banners are automatically created for latest posts in the directory specified by parameter `sidebar_url`. +
Parameter `sidebar_maxnum` define the maximum number of banners at sidebar. + +Ex. banners are automatically created for latest 10 posts in the directory `/post`: +```config.toml +[Params] +... + sidebar_maxnum = 10 + sidebar_url = "/post" +... +``` + +You can also create fixed banner. +See **[FRONT MATTER]()**. + +Below the banners list, "Links" is prepared. + +This is determined by parameters `link` and `linkPath`. +In the following case, the page created by `/foo/bar/content/link/index.en.md` is corresponded. + +```config.toml +[Languages.en.params] + link = "DISPLAYED NAME" + linkPath = "en/link" #Permenent link of "Links". +``` + +### Footer +Footer is consisted by "sitemap" and "location". + +1. Sitemap is created by `/foo/bar/content/sitemap.en.md`. +2. Location is created with the parameter block `[[Params.address]]`. +
You can set several locations. + +``` config.toml +[[Params.address]] + description = "BUILDING" + postcode = "POSTCODE" + address = "ADDRESS" + room = "ROOM NUMBER" + tel = "XXX-XXXX-XXXX" + fax = "XXX-XXXX-XXXX" + googlemap_url = "https://www.google.com/maps/****" #Shared link from google map. +``` +Embedded google maps are shown at the page `/access` + +### taxsonomies +To be updated. + +## How to edit each page (About front matter) + + + diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 43c2bdf376c75be7eb35741cfb1cfcbd628de407..133c87594b025026d3207f3c62bf7762c3a0d189 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -1,13 +1,4 @@ -{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} - - -{{ end }} + +
+ {{ template "_internal/pagination.html" . }} +
diff --git a/static/css/list.css b/static/css/list.css index 1a5ae04304e64690645f76feb9a14011d9a87ed9..af39daeeed37134be7ad748db317e5b3bc8b15f5 100644 --- a/static/css/list.css +++ b/static/css/list.css @@ -1,15 +1,42 @@ .year { width: 100%; - margin: auto; - text-align: center; + margin-left: 45px; + text-align: left; } +/* .year h1 { position: relative; display: inline-block; - padding: 0 55px; + padding: 0 21px; +} +*/ +.year h1 { + position: relative; + padding-left: 25px; +} + +.year h1:before { + position: absolute; + content: ''; + bottom: -3px; + left: 0; + width: 0; + height: 0; + border: none; + border-left: solid 15px transparent; + border-bottom: solid 15px rgb(47, 79,79); +} +.year h1:after { + position: absolute; + content: ''; + bottom: -3px; + left: 10px; + width: 70%; + border-bottom: solid 3px rgb(47, 79,79); } +/* .year h1:before, .year h1:after { content: ''; position: absolute; @@ -26,3 +53,4 @@ .year h1:after { right: 0; } +*/ diff --git a/static/css/nav.css b/static/css/nav.css deleted file mode 100644 index 784f5864e3db9794d142d694aee7f41fb836535d..0000000000000000000000000000000000000000 --- a/static/css/nav.css +++ /dev/null @@ -1,18 +0,0 @@ -.page-link { - margin-top: 20px; - width: auto; - font-size: 20px; - font-weight: bold; - /*padding: 0.25em 0.25em; */ - padding: 1px 7px 1px 7px; - border-radius: 4px; - transition: .4s; - text-decoration: none; - border: solid 1px black; - color: black; -} - -.page-link:hover { - background: black; - color: white; -} diff --git a/static/css/pagination.css b/static/css/pagination.css new file mode 100644 index 0000000000000000000000000000000000000000..252cb716136811de678062325b7a06023ff06b06 --- /dev/null +++ b/static/css/pagination.css @@ -0,0 +1,71 @@ +.pagination-class { + padding: 0px; + text-align: center; + height: 50px; +} + +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #337ab7; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 2; + color: #23527c; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.agination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 3; + color: #fff; + cursor: default; + background-color: #337ab7; + border-color: #337ab7; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +