-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e296227
commit 5986017
Showing
7 changed files
with
105 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from "react" | ||
import { Link } from "gatsby" | ||
import { Container, Row, Col } from "react-bootstrap" | ||
import { useSiteMetadata } from "../hooks" | ||
import { Github } from "iconoir-react" | ||
|
||
const getGithubRepoUrl = (gitRepo, gitRevision) => { | ||
// Regular expression to extract the repository path from the gitRepo string | ||
const repoRegex = /github\.com[:/](.*)\.git/ | ||
const repoMatches = gitRepo.match(repoRegex) | ||
if (repoMatches && repoMatches.length > 1) { | ||
const repoPath = repoMatches[1] | ||
return `https://github.com/${repoPath}/commit/${gitRevision}` | ||
} else { | ||
console.error("Invalid gitRepo format.") | ||
return null | ||
} | ||
} | ||
|
||
const Footer = () => { | ||
const site = useSiteMetadata() | ||
const gitRepoUrl = getGithubRepoUrl(site.gitRepo, site.gitRevision) | ||
|
||
console.log("[Footer] render site:", site) | ||
return ( | ||
<footer className="mt-5"> | ||
<Container> | ||
<Row> | ||
<Col>{site.title}</Col> | ||
<Col> | ||
<ul> | ||
<li> | ||
<Link to="/">impresso-datalab</Link> | ||
</li> | ||
<li> | ||
<Link to="/about">about!</Link> | ||
</li> | ||
</ul> | ||
</Col> | ||
<Col> | ||
Current version: | ||
<br /> | ||
<a | ||
href={gitRepoUrl} | ||
target="_blank" | ||
rel="noreferrer" | ||
title="check github repo" | ||
> | ||
<Github /> | ||
<span className="ms-2"> | ||
{site.gitBuildTag} / {site.gitRevision} | ||
</span> | ||
</a> | ||
</Col> | ||
</Row> | ||
</Container> | ||
</footer> | ||
) | ||
} | ||
|
||
export default Footer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
import { Link } from "gatsby"; | ||
import React from "react"; | ||
import { Col, Container, Row } from "react-bootstrap"; | ||
import Header from "./Header"; | ||
import { useDataStore } from "../store"; | ||
import Background from "./Background"; | ||
import React from "react" | ||
import Header from "./Header" | ||
import Footer from "./Footer" | ||
import Background from "./Background" | ||
|
||
const Layout = ({ children }) => { | ||
const isDataReady = useDataStore((state) => state.isReady); | ||
|
||
console.log("[Layout] render"); | ||
console.log("[Layout] render") | ||
return ( | ||
<> | ||
<Header /> | ||
<main>{children}</main> | ||
<footer> | ||
<Container> | ||
<Row> | ||
<Col> | ||
<ul> | ||
<li> | ||
<Link to="/">impresso-datalab</Link> | ||
</li> | ||
<li> | ||
<Link to="/about">about!</Link> | ||
</li> | ||
</ul> | ||
</Col> | ||
<Col>{isDataReady ? "ready" : "loading"}</Col> | ||
</Row> | ||
</Container> | ||
</footer> | ||
<Footer /> | ||
<Background /> | ||
</> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default Layout; | ||
export default Layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useStaticQuery, graphql } from "gatsby" | ||
|
||
export const useSiteMetadata = () => { | ||
const { site } = useStaticQuery(graphql` | ||
query SiteQuery { | ||
site { | ||
siteMetadata { | ||
title | ||
siteUrl | ||
gitBuildTag | ||
gitBranch | ||
gitRevision | ||
gitRepo | ||
} | ||
} | ||
} | ||
`) | ||
return site.siteMetadata | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
--- | ||
title: 'Introduction to topic modeling' | ||
title: "Introduction to topic modeling" | ||
url: https://colab.research.google.com/github/littlecolumns/ds4j-notebooks/blob/master/text-analysis/notebooks/Introduction%20to%20topic%20modeling.ipynb | ||
author: '@littlecolumns' | ||
author: "@littlecolumns" | ||
--- | ||
|
||
Make |