Skip to content

Commit

Permalink
allow overriding some variables for self hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
kernoeb committed Sep 4, 2024
1 parent 7398978 commit 9d64f91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
13 changes: 7 additions & 6 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { NODE_ENV = 'production' } = process.env
const isDev = NODE_ENV === 'development'

const PLAUSIBLE_DOMAIN = 'plausible.noewen.com'
const DESCRIPTION = 'Un planning universitaire moderne réalisé par @kernoeb'
const TITLE = 'PlanningSup'
const META_TITLE = `${TITLE} | Calendrier universitaire`
const DOMAIN = 'planningsup.app'
const URL = 'https://' + DOMAIN
const TITLE = process.env.DEPLOY_TITLE || 'PlanningSup'
const DESCRIPTION = process.env.DEPLOY_DESCRIPTION || 'Un planning universitaire moderne réalisé par @kernoeb'
const PLAUSIBLE_DOMAIN = process.env.DEPLOY_PLAUSIBLE_DOMAIN || 'plausible.noewen.com'
const META_TITLE = process.env.DEPLOY_META_TITLE || `${TITLE} | Calendrier universitaire`
const DOMAIN = process.env.DEPLOY_DOMAIN || 'planningsup.app'
const URL = `https://${DOMAIN}`
const BANNER = `${URL}/banner.png`

export default {
Expand Down Expand Up @@ -169,6 +169,7 @@ export default {
},
name: 'PlanningSup',
hideWeekends: process.env.HIDE_WEEKENDS !== 'false',
defaultPlanning: process.env.DEFAULT_PLANNING_ID || 'iutdevannes.butdutinfo.1ereannee.gr1a.gr1a1',
i18n: {
week: 'Semaine',
weeks: 'Semaines',
Expand Down
5 changes: 2 additions & 3 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,12 @@ export default {
}
if (this.selectedPlanningsIds == null) {
const defaultPlanning = 'iutdevannes.butdutinfo.1ereannee.gr1a.gr1a1'
let planningString
try {
planningString = this.$route?.query?.p || this.$cookies.get('plannings', { parseJSON: false }) || defaultPlanning
planningString = this.$route?.query?.p || this.$cookies.get('plannings', { parseJSON: false }) || this.$config.defaultPlanning
} catch (err) {
console.log(err)
planningString = defaultPlanning
planningString = this.$config.defaultPlanning
}
this.selectedPlanningsIds = planningString.split(',')
} else if (this.selectedPlanningsIds && this.selectedPlanningsIds.length === 0) {
Expand Down

0 comments on commit 9d64f91

Please sign in to comment.