Skip to content

Commit

Permalink
Header and layout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnyder committed Oct 26, 2021
1 parent 681f999 commit 7c2dee7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ module.exports = {
</script>

<style>
<style scoped>
html {
scroll-behavior: smooth;
Expand Down
1 change: 1 addition & 0 deletions components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@
display: flex;
padding: 0.5em 0;
font-size: 1.1em;
color: #333;
}
#menu li i {
Expand Down
2 changes: 1 addition & 1 deletion components/VisualEssay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ module.exports = {
}
</script>

<style>
<style scoped>
.cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr) );
Expand Down
22 changes: 10 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ <h1>Update Juncture site</h1>

<script>

const ENV = window.location.hostname === 'localhost' || window.location.hostname.indexOf('gitpod') > 0 || window.location.hostname.indexOf('githubpreview.dev') > 0 || window.location.hostname.indexOf('netlify.app') > 0 ? 'DEV' : 'PROD'
const ENV = window.location.port === '8088' || window.location.hostname.indexOf('8088') >= 0 ? 'DEV' : 'PROD'
let isJuncture = window.location.hostname.indexOf('juncture-digital.org') === 0 || ENV === 'DEV'
const junctureVersion = 'v0.5.1'
const junctureVersion = 'v0.5.2'
let junctureVersionHash
let qargs = window.location.href.indexOf('?') > 0 ? parseQueryString(window.location.href.split('?')[1]) : {}

const referrerUrl = document.referrer
if (referrerUrl) {
Expand Down Expand Up @@ -247,7 +248,7 @@ <h1>Update Juncture site</h1>
async function getContentSource() {
let contentSource

if (window.location.port === '8088' || window.location.host.indexOf('8888') > 0 || window.location.host.indexOf('juncture-digital.org') >= 0) {
if (window.location.port === '8088' || window.location.host.indexOf('8088') >= 0 || window.location.host.indexOf('juncture-digital.org') >= 0) {
contentSource = {
acct: 'jstor-labs', repo: 'juncture-digital', ref: 'main', hash: null, basePath: '', isGhpSite: false,
baseUrl: window.location.origin,
Expand All @@ -262,7 +263,7 @@ <h1>Update Juncture site</h1>
}
}

} else if (window.location.port === '8080' || window.location.host.indexOf('8080') === 0) {
} else if (window.location.port === '8080' || window.location.host.indexOf('8080') >= 0) {
// For local dev in GHP mode
// let repo = window.location.pathname.split('/').filter(elem => elem !== '')[0] || 'juncture'
let repo = 'juncture'
Expand Down Expand Up @@ -295,8 +296,6 @@ <h1>Update Juncture site</h1>
}
return contentSource
}

let qargs = window.location.href.indexOf('?') > 0 ? parseQueryString(window.location.href.split('?')[1]) : {}

// GLobal variables used to initialize Vue
let siteConfig, contentSource, componentsList, ghUnscopedToken, oauthAccessToken, gcApiKey, gcAuthDomain, gaPropertyID, fontawesome
Expand Down Expand Up @@ -378,7 +377,7 @@ <h1>Update Juncture site</h1>
if (gaPropertyID) ga('create', gaPropertyID, 'auto')
if (siteConfig.description) setMetaDescription(siteConfig.description)
let attrsWithUrls = ['banner', 'favicon', 'logo']
if ((window.location.hostname === 'localhost' || window.location.hostname.indexOf('gitpod.io') > 0 || window.location.hostname.indexOf('githubpreview.dev') > 0 || window.location.hostname.indexOf('netlify.app') > 0) && (contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture-digital') ) {
if ((window.location.port === '8088' || window.location.hostname.indexOf('8088') >= 0) && (contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture-digital') ) {
attrsWithUrls.forEach(attr => { if (config[attr]) config[attr] = convertURL(config[attr]) })
} else {
headRef(contentSource.acct, contentSource.repo, contentSource.ref).then(headHash => {
Expand Down Expand Up @@ -673,7 +672,7 @@ <h1>Update Juncture site</h1>

async getMarkdown(path) {
// if ((window.location.hostname === 'localhost' || window.location.hostname.indexOf('gitpod.io') > 0) && (contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture-digital')) {
if ((window.location.hostname === 'localhost' || window.location.hostname.indexOf('gitpod.io') > 0 || window.location.hostname.indexOf('githubpreview.dev') > 0 || window.location.hostname.indexOf('netlify.app') > 0) && (contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture-digital')) {
if (window.location.port === '8080' || window.location.hostname.indexOf('8080') >= 0) {
let url = `${contentSource.baseUrl}${contentSource.basePath}${path}`
let resp = await fetch(url)
if (resp.ok) return await resp.text()
Expand Down Expand Up @@ -1099,7 +1098,7 @@ <h1>Update Juncture site</h1>
// logging watchers
params (params) {
// console.log('params', params)
// Load custom compoxnents declared in page markdown
// Load custom components declared in page markdown
params
.filter(param => param['ve-component'] !== undefined)
.map(param => param.url)
Expand Down Expand Up @@ -1327,7 +1326,7 @@ <h1>Update Juncture site</h1>
// Gets site config
async function getSiteConfig() {
let config = {}
let configUrl = window.location.port === '8088' || window.location.host.indexOf('8088') === 0
let configUrl = window.location.port === '8088' || window.location.host.indexOf('8088') >= 0
? `${window.location.origin}/config.yaml`
: window.location.host.indexOf('juncture-digital.org') >= 0
? `https://juncture-digital.org/config.yaml`
Expand Down Expand Up @@ -1421,8 +1420,7 @@ <h1>Update Juncture site</h1>

let ref = contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture' ? junctureVersionHash : contentSource.ref

if ((window.location.hostname === 'localhost' || window.location.hostname.indexOf('gitpod') > 0 || window.location.hostname.indexOf('githubpreview.dev') > 0 || window.location.hostname.indexOf('netlify.app') > 0) && (contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture-digital')) {

if ((window.location.port === '8080' || window.location.port === '8088' || window.location.hostname.indexOf('8080') >= 0 || window.location.hostname.indexOf('8088') >= 0) && (contentSource.acct === 'jstor-labs' && contentSource.repo === 'juncture-digital')) {
componentsList = [...componentsList, ...await listComponents(
`${contentSource.baseUrl}${contentSource.isGhpSite ? contentSource.basePath : ''}`, 'custom/components')]
componentsList = [...componentsList, ...await listComponents(
Expand Down

0 comments on commit 7c2dee7

Please sign in to comment.