Skip to content

Conversation

@surfer77
Copy link

I think it's important to be able to use custom code apart from script,style,and content inside the head.

almost all 3rd party apps like google analytics, intercom, google webmaster tools, etc will require you to add a custom snippets to the head of the page.

@surfer77
Copy link
Author

this.setupCustomString(vueObject);

else if (metaItem.custom) {
                            this.metaTags += metaItem.custom + '\n';
                        }
{
        key: 'setupCustomString',
        value: function setupCustomString(customString) {
            if (customString) {
                this.custom = customString;
            } else {
                this.custom = '';
            }
        }
    }
{
        key: 'toString',
        value: function toString() {
            return '<head>\n' + this.title + this.metaTags + this.structuredData + this.style + this.custom + '</head>';
        }

@danielcherubini
Copy link
Contributor

sorry, but you've got compiled code there in the source file..

https://github.com/express-vue/express-vue-renderer/blob/master/src/utils/head.js

can you please write this in es5+, and submit the actual source file, not the compiled version

Copy link
Contributor

@danielcherubini danielcherubini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a source file, a compiled file

@danielcherubini
Copy link
Contributor

also please not "custom" .. please use something more easily recognisable like "srcString" or "srcContents"

@surfer77
Copy link
Author

surfer77 commented Sep 22, 2017

sorry, but you've got compiled code there in the source file..

https://github.com/express-vue/express-vue-renderer/blob/master/src/utils/head.js

can you please write this in es5+, and submit the actual source file, not the compiled version

I am trying to figure out what all those things mean and I will commit once I do and fix.

@danielcherubini
Copy link
Contributor

  1. Fork this repo
  2. clone that fork to your machine
  3. npm install
  4. now, in the src folder you will find the source files... edit the head.js in there please use flow typing https://flow.org
  5. you will find the example version in the tests/example folder
  6. write your new stuff there too..
  7. in tests/utils/head.js write a unit test for what you just wrote, tests are written using AVA.js
  8. to run the server and test it npm run debug (this needs to be manually killed and restarted when you make changes, we haven't got around to automating that)
  9. when you're ready... make a pull request..

@danielcherubini
Copy link
Contributor

I've done this for you in #92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants