Skip to content

pages build and deployment #1

pages build and deployment

pages build and deployment #1

Triggered via dynamic November 30, 2024 05:22
Status Failure
Total duration 39s
Artifacts

pages-build-deployment

on: dynamic
report-build-status
4s
report-build-status
deploy
deploy
Fit to window
Zoom out
Zoom in

Annotations

1 error
build
Logging at level: debug GitHub Pages: github-pages v232 GitHub Pages: jekyll v3.10.0 Theme: jekyll-theme-primer Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0 Requiring: jekyll-github-metadata Requiring: jekyll-seo-tag Requiring: jekyll-coffeescript Requiring: jekyll-commonmark-ghpages Requiring: jekyll-gist Requiring: jekyll-github-metadata Requiring: jekyll-paginate Requiring: jekyll-relative-links Requiring: jekyll-optional-front-matter Requiring: jekyll-readme-index Requiring: jekyll-default-layout Requiring: jekyll-titles-from-headings GitHub Metadata: Initializing... Source: /github/workspace/. Destination: /github/workspace/./_site Incremental build: disabled. Enable with --incremental Generating... Generating: JekyllOptionalFrontMatter::Generator finished in 0.002171871 seconds. Generating: JekyllReadmeIndex::Generator finished in 0.003542397 seconds. Generating: Jekyll::Paginate::Pagination finished in 3.917e-06 seconds. GitHub Metadata: Generating for addyosmani/backbone-fundamentals GitHub Metadata: Calling @client.pages("addyosmani/backbone-fundamentals", {}) Generating: JekyllRelativeLinks::Generator finished in 0.408634652 seconds. Generating: JekyllDefaultLayout::Generator finished in 0.000325737 seconds. Requiring: kramdown-parser-gfm Generating: JekyllTitlesFromHeadings::Generator finished in 0.012678878 seconds. Rendering: assets/css/style.scss Pre-Render Hooks: assets/css/style.scss Rendering Markup: assets/css/style.scss Rendering: INSTRUCTIONS-pandoc-ebooks.md Pre-Render Hooks: INSTRUCTIONS-pandoc-ebooks.md Rendering Markup: INSTRUCTIONS-pandoc-ebooks.md Rendering Layout: INSTRUCTIONS-pandoc-ebooks.md Layout source: theme GitHub Metadata: Calling @client.repository("addyosmani/backbone-fundamentals", {:accept=>"application/vnd.github.drax-preview+json"}) Rendering: backbone-fundamentals.md Pre-Render Hooks: backbone-fundamentals.md Rendering Liquid: backbone-fundamentals.md github-pages 232 | Error: Liquid syntax error (line 4200): Tag '{%> <%= keyobj.keyword %><% } ); %></li> ``` Here I iterate over the keywords array using the Underscore `each` function and print out every single keyword. Note that I display the keyword using the <%= tag. This will display the keywords with spaces between them. Reloading the page again should look quite decent: ![](/backbone-fundamentals/img/chapter5-10.png) Now go ahead and delete a book and then reload the page: Tadaa! the deleted book is back! Not cool, why is this? This happens because when we get the BookModels from the server they have an _id attribute (notice the underscore), but Backbone expects an id attribute (no underscore). Since no id attribute is present, Backbone sees this model as new and deleting a new model doesn’t need any synchronization. To fix this, we can use the parse function of Backbone.Model. The parse function lets you edit the server response before it is passed to the Model constructor. Add a parse method to the Book model: ```javascript parse: function( response ) { response.id = response._id; return response; } ``` Simply copy the value of _id to the needed id attribute. If you reload the page, you will see that models are actually deleted on the server when you press the delete button. Another, simpler way of making Backbone recognize _id as its unique identifier is to set the idAttribute of the model to _id. If you now try to add a new book using the form, you’ll notice that it is a similar story to delete – models won't get persisted on the server. This is because Backbone.Collection.add doesn’t automatically sync, but it is easy to fix. In the LibraryView, we find in `views/library.js` change the line reading: ```javascript this.collection.add( new Book( formData ) ); ``` …to: ```javascript this.collection.create( formData ); ``` Now, newly created books will get persisted. Actually, they probably won't if you enter a date. The server expects a date in UNIX timestamp format (milliseconds since Jan 1, 1970). Also, any keywords you enter won't be stored since the server expects an array of objects with the attrib