Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext.org
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext.org
Commits
0a83209d
Commit
0a83209d
authored
Jun 18, 2024
by
Fabien Maniere
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
custom config for hakyll
parent
555a9783
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
25 deletions
+60
-25
README.md
README.md
+27
-0
.gitignore
gargantext-org-website/.gitignore
+3
-0
site.hs
gargantext-org-website/site.hs
+30
-25
No files found.
README.md
View file @
0a83209d
# gargantext.org
Simple website to present GarganText.
---
## Requirements
-
install
**cabal**
-
install
**hakyll**
:
A Haskell library to manage simple websites (https://jaspervdj.be/hakyll/)
`cabal install hakyll`
## Build and watch
cabal install --overwrite-policy=always #Needed to take account of the custom config in site.hs
site build
site watch
Go to http://localhost:7000
## Hakyll Documentation
Hakyll help and customization: https://robertwpearce.com/hakyll-pt-1-setup-initial-customization.html
Code: https://github.com/jaspervdj/hakyll
\ No newline at end of file
gargantext-org-website/.gitignore
0 → 100644
View file @
0a83209d
# Ignore files:
_site
_cache
gargantext-org-website/site.hs
View file @
0a83209d
...
...
@@ -6,8 +6,8 @@ import Hakyll
--------------------------------------------------------------------------------
main
::
IO
()
main
=
hakyll
$
do
match
"images/*"
$
do
main
=
hakyll
With
config
$
do
match
(
"js/*"
.||.
"images/*"
.||.
"favicon/*"
.||.
"css/fonts/*"
)
$
do
route
idRoute
compile
copyFileCompiler
...
...
@@ -15,32 +15,32 @@ main = hakyll $ do
route
idRoute
compile
compressCssCompiler
match
(
fromList
[
"about.rst"
,
"contact.markdown"
])
$
do
route
$
setExtension
"html"
compile
$
pandocCompiler
>>=
loadAndApplyTemplate
"templates/default.html"
defaultContext
>>=
relativizeUrls
--
match (fromList ["about.rst", "contact.markdown"]) $ do
--
route $ setExtension "html"
--
compile $ pandocCompiler
--
>>= loadAndApplyTemplate "templates/default.html" defaultContext
--
>>= relativizeUrls
match
"posts/*"
$
do
route
$
setExtension
"html"
compile
$
pandocCompiler
>>=
loadAndApplyTemplate
"templates/post.html"
postCtx
>>=
loadAndApplyTemplate
"templates/default.html"
postCtx
>>=
relativizeUrls
--
match "posts/*" $ do
--
route $ setExtension "html"
--
compile $ pandocCompiler
--
>>= loadAndApplyTemplate "templates/post.html" postCtx
--
>>= loadAndApplyTemplate "templates/default.html" postCtx
--
>>= relativizeUrls
create
[
"archive.html"
]
$
do
route
idRoute
compile
$
do
posts
<-
recentFirst
=<<
loadAll
"posts/*"
let
archiveCtx
=
listField
"posts"
postCtx
(
return
posts
)
`
mappend
`
constField
"title"
"Archives"
`
mappend
`
defaultContext
--
create ["archive.html"] $ do
--
route idRoute
--
compile $ do
--
posts <- recentFirst =<< loadAll "posts/*"
--
let archiveCtx =
--
listField "posts" postCtx (return posts) `mappend`
--
constField "title" "Archives" `mappend`
--
defaultContext
makeItem
""
>>=
loadAndApplyTemplate
"templates/archive.html"
archiveCtx
>>=
loadAndApplyTemplate
"templates/default.html"
archiveCtx
>>=
relativizeUrls
--
makeItem ""
--
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
--
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
--
>>= relativizeUrls
match
"index.html"
$
do
...
...
@@ -64,3 +64,8 @@ postCtx :: Context String
postCtx
=
dateField
"date"
"%B %e, %Y"
`
mappend
`
defaultContext
config
::
Configuration
config
=
defaultConfiguration
{
previewPort
=
7000
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment